import { Token } from "@/types/data"
import { LoginAction } from "@/types/store"
const initialValue: Token = {
  token: '',
  refresh_token: '',
}

export default function login(state = initialValue, action: LoginAction) {
  switch (action.type) {
    case 'login/token':
      return action.payload
    case 'login/logout':
      return {
        token: '',
        refresh_token: ''
      }
    default:
      return state
  }
}